<?php
$req = $bdd->query('SELECT COUNT(id) AS nombre_total FROM citations');
$donnees = $req->fetch();
$nombre_total=($donnees['nombre_total']-1);
$hasard=rand(1,$nombre_total);

$req = $bdd->prepare('SELECT * FROM citations WHERE id=:id');
$req->execute(array('id' => $hasard));
while ($donnees = $req->fetch())
{
	?>
	<p>"<?php echo $donnees['citation']; ?>"<br/> - <?php echo $donnees['auteur']; ?> - </p>
	<?php
}
$req->closeCursor();
?>
